package com.jswdwsx.esign.entity

import com.jswdwsx.esign.service.enums.EsignNoticeTypeEnum
import com.jswdwsx.esign.service.enums.EsignSignPlatformEnum
import org.hibernate.annotations.DynamicInsert
import org.hibernate.annotations.DynamicUpdate
import org.hibernate.annotations.GenericGenerator
import org.hibernate.annotations.Parameter
import org.springframework.data.jpa.domain.support.AuditingEntityListener
import javax.persistence.*

@Entity
@EntityListeners(AuditingEntityListener::class)
@DynamicInsert
@DynamicUpdate
@Table(name = "flow_template")
data class FlowTemplatePO(

    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @GenericGenerator(name = "jpa-uuid", strategy = "uuid")
    var id: String? = null,

    @Column(name = "template_name")
    var templateName: String? = null,

    @Column(name = "scene")
    var scene: String,

    @Column(name = "need_identity")
    var needIdentity: Boolean,

    @Column(name = "sign_platform")
    @Enumerated(EnumType.STRING)
    var signPlatform: EsignSignPlatformEnum,

    @Column(name = "contract_validity")
    var contractValidity: Long? = null,

    @Column(name = "contract_remind")
    var contractRemind: Int? = null,

    @Column(name = "sign_validity")
    var signValidity: Long? = null,

    @Column(name = "notice_type")
    @Enumerated(EnumType.STRING)
    var noticeType: EsignNoticeTypeEnum? = null
)
